// import axios from '@/core/axios';
// import api from '@/core/api';
// import { IMAGE_PATH } from '@/config'
import { API_URL } from '../api/config'

export default {
  install: (Vue: any, options: any) => {
    Vue.prototype.$apiUrl = API_URL;
    Vue.prototype.$downloadRoot = window.location.origin + '/download/'
    Vue.prototype.$downloadUrl = window.location.origin + '/download/农户基础数据.xls';
    Vue.prototype.$downloadMembersUrl = window.location.origin + '/download/家庭成员.xls';
    Vue.prototype.$downloadGrainsUrl = window.location.origin + '/download/补贴登记.xls';
    Vue.prototype.$downloadGrainTemplate = window.location.origin + '/download/补贴对象模板.xls';
    Vue.prototype.$downloadLargeMemberTemplate = window.location.origin + '/download/大户地力详细数据模板.xlsx';
    Vue.prototype.$downloadDeadMembers = window.location.origin + '/download/农户减员(死亡)登记表模板.xlsx';
    Vue.prototype.$downloadV2BankBack = window.location.origin + '/download/耕保补贴资金兑付明细表（信息回收模板2.0，请保持格式填写）.xlsx';

    Vue.prototype.$downloadTemplate = (name: string) => {
      const a = document.createElement('a')
      a.href = Vue.prototype.$downloadRoot + name
      a.target = '_blank'
      a.click()
    }
    
    // Vue.prototype.$ajax = axios;
    // Vue.prototype.$http = axios;
    // // 需要挂载的都放在这里
    // Vue.prototype.$imgUrl = IMAGE_PATH.imgUrl;
  }
}
